﻿using Dict.DataModel;
using System;
using System.Collections.Generic;


namespace Battle.Engine.LogicModel
{
    public class FSkillBuff
    {
        public BUFFHitClass buffHitClass;
        public BuffCondition triggerCondition;//buff挂载条件
        public FBuffTrigger buffTrigger;

        FSkillCast skillCast;

        public FSkillBuff(FSkillCast skillCast, string buffid, BUFFHitClass buffHitClass, BuffTriggerCondition condition, string conditionArgs, double percent, int select)
        {
            this.skillCast = skillCast;
            this.buffHitClass = buffHitClass;
            switch (condition)
            {
                case BuffTriggerCondition.PropertyVal:
                    this.triggerCondition = new PropertyValCondition();
                    this.triggerCondition.init(this.skillCast.skill.actor, conditionArgs);
                    break;
                case BuffTriggerCondition.HpPercent:
                    this.triggerCondition = new HpPercentCondition();
                    this.triggerCondition.init(this.skillCast.skill.actor, conditionArgs);
                    break;
                default:
                    //未实现的条件类型一律处理成无条件限制
                    this.triggerCondition = new BuffCondition();
                    this.triggerCondition.init(this.skillCast.skill.actor, conditionArgs);
                    break;
            }
            this.buffTrigger = new FBuffTrigger(buffid, percent, select, this.skillCast.skill.actor.player.engineData);
            
        }

    }
}
